package com.threeti.mecool.core.domain.model.acl;

import javax.persistence.Column;
import javax.persistence.Embeddable;

import com.threeti.mecool.shared.util.AbstractTreeNode;

/**
 * 组织机构员工(来自于遗留的 组织机构员工(ProjectEmployeeTreeNode) ，本模型也是组织机构员工树上的某个节点)
 * 
 * @author Jay Meng
 */
@Embeddable
public class OrgnizationEmployee extends AbstractTreeNode<Long> {
  
  private String orgCode;
  
  @Column(name="EMP_PK")
  private Long empId;
  
  @Column(name="EMP_NAME")
  private String name;//jay:only for orm redundant copy
  
  @Column(name="EMP_ORG_TITLE")
  private String titleWithinTheOrg;//jay:only for orm redundant copy

  public OrgnizationEmployee(Long id) {
  	super(id);
    this.empId = id;
  }

  public OrgnizationEmployee(Long id, String name) {
    super(id, name);
    this.empId = id;
    this.name = name;
  }

  public OrgnizationEmployee(Long id, String orgCode, String name) {
    this(id, name);    
    this.orgCode = orgCode;
  }

  @Override
  public Long getId() {
    return super.getId();
  }

  @Override
  public String getName() {
    return this.name;
  }

  public String getOrgCode() {
    return orgCode;
  }

  public void setOrgCode(String orgCode) {
    this.orgCode = orgCode;
  }

  /** 取得员工编号，此处员工编号的取值是(理论上唯一的)员工PK，而非系统流水Id，该员工PK从遗留系统中读入，员工还有对应的员工Code，但此处取得是员工PK，而非Code */
  public Long getEmpId() {
    return empId;
  }

  public String getTitleWithinTheOrg() {
    return titleWithinTheOrg;
  }

  @Override
  public String toString() {
    return "ProjectEmployeeTreeNode [id=" + getId() + ", name=" + getName() + "]";
  }
  
  public OrgnizationEmployee() {    
  }

  public void setName(String name) {
    super.setName(name);
    this.name = name;
  }

  public void setTitleWithinTheOrg(String titleWithinTheOrg) {
    this.titleWithinTheOrg = titleWithinTheOrg;
  }

  public void setEmpId(Long empId) {
    this.empId = empId;
  }
  
}
